From: Boris Ostrovsky Date: Fri, 23 Sep 2016 16:23:47 +0000 (+0200) Subject: acpi: Makefile should better tolerate interrupts X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~370 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=837b5eefa709ad174bf4dad95c15e8043066d9ad;p=xen.git acpi: Makefile should better tolerate interrupts Intermediate stages of building a target should be made with temporary files that are copied to final target in the end. Signed-off-by: Boris Ostrovsky Acked-by: Jan Beulich --- diff --git a/tools/firmware/hvmloader/acpi/Makefile b/tools/firmware/hvmloader/acpi/Makefile index d3e882ac69..45de14a563 100644 --- a/tools/firmware/hvmloader/acpi/Makefile +++ b/tools/firmware/hvmloader/acpi/Makefile @@ -22,6 +22,9 @@ OBJS = $(patsubst %.c,%.o,$(C_SRC)) CFLAGS += $(CFLAGS_xeninclude) +# Suffix for temporary files. +TMP_SUFFIX = tmp + vpath iasl $(PATH) all: acpi.a @@ -34,18 +37,21 @@ mk_dsdt: mk_dsdt.c $(HOSTCC) $(HOSTCFLAGS) $(CFLAGS_xeninclude) -o $@ mk_dsdt.c dsdt_anycpu_qemu_xen.asl: dsdt.asl mk_dsdt - awk 'NR > 1 {print s} {s=$$0}' $< > $@ - ./mk_dsdt --debug=$(debug) --dm-version qemu-xen >> $@ + awk 'NR > 1 {print s} {s=$$0}' $< > $@.$(TMP_SUFFIX) + ./mk_dsdt --debug=$(debug) --dm-version qemu-xen >> $@.$(TMP_SUFFIX) + mv -f $@.$(TMP_SUFFIX) $@ # NB. awk invocation is a portable alternative to 'head -n -1' dsdt_%cpu.asl: dsdt.asl mk_dsdt - awk 'NR > 1 {print s} {s=$$0}' $< > $@ - ./mk_dsdt --debug=$(debug) --maxcpu $* >> $@ + awk 'NR > 1 {print s} {s=$$0}' $< > $@.$(TMP_SUFFIX) + ./mk_dsdt --debug=$(debug) --maxcpu $* >> $@.$(TMP_SUFFIX) + mv -f $@.$(TMP_SUFFIX) $@ $(filter dsdt_%.c,$(C_SRC)): %.c: iasl %.asl iasl -vs -p $* -tc $*.asl - sed -e 's/AmlCode/$*/g' $*.hex >$@ - echo "int $*_len=sizeof($*);" >>$@ + sed -e 's/AmlCode/$*/g' $*.hex >$@.$(TMP_SUFFIX) + echo "int $*_len=sizeof($*);" >>$@.$(TMP_SUFFIX) + mv -f $@.$(TMP_SUFFIX) $@ rm -f $*.aml $*.hex iasl: @@ -63,7 +69,7 @@ acpi.a: $(OBJS) clean: rm -rf *.a *.o $(IASL_VER) $(IASL_VER).tar.gz $(DEPS) - rm -rf ssdt_*.h dsdt*.c *~ *.aml *.hex mk_dsdt dsdt_*.asl + rm -rf ssdt_*.h dsdt*.c *~ *.aml *.hex mk_dsdt dsdt_*.asl *.$(TMP_SUFFIX) distclean: clean